in need of refactoring