Starting to refactor the core module