#33 refactored