still working after the refactoring