All functionalities inside the cases are written in a seperate method.