refactoring again...