More refactor needed! :)