ugh. refactor.