Code Refactor

Refactoring the project
Improving memory management and List implementation