add autoloadModels function and many common helpers