Using final variables where possible
Extracted switch to method