Removed redundancies
Cleaned up functions and added seperate config file