fixing refactoring from last time