Implement model caching

whitespace fixes, and change static member name