some refactoring regarding models