Some refactoring before adding modules