fixes on refactoring