Fixed refactoring new functions