Second Commit. Refactor almost done