(refactor) Cleaning up code