fixed prior refactoring