Refactoring and implementing new ideas