Fix features and refactore them to reduce duplication