Moved html stuff from lines handler to a template