minor refactor to remove WET code