refactored fold directive