Removed some functions to their own module.