Moved functions and variables to central function file.