minor code cleanup + simplfied helper line code