Major style overhaul and refactoring