refactored, again