Precache models
Misc code style adjustments