Home refactoring code