Refactoring and changes