massive refactor - new model