tried refactoring again