refactor fancyness