extracting out cons nodes to own class