Simple Arraylist implmentation and some refactoring.