Mega refactoring & clean-up