Split models, util funcs and config into separate files