Refactor list implementation