Refactoring: using modules instead of inheritance for models