Refactored for readability + added settings.h