refactoring models and problem design