Fix, improvements for refactoring