Refactoring features code