better names, return error instead of panicking, better diagnostics, use the standard APIs for resolving values