Remove use of Cons and Nil