Ok, in answer to your first question, you do not have to put the code into a method, it can be placed into a class constructor. This will be called when the object of that class is created:

Case()...