refactored! omfg