Separate models from DB utilities, restructure app to supprt change