Beginning of refactoring