Refactored source in main file, reduced loging