move logic onto the line directive