optimize capture_haml line to create fewer objects