Begin of refactoring code