Domain modeling and refactoring