Code cleanup + fix for lazy loading constants.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>