Some refactoring to model object