Fixes some refactoring