Refactoring and testing fix features