refactoring: probably not working