Refactoring, removing unneeded functions.