Cleanup for previous PR: using switch statement and spaces instead of tabs