Dinodex oop

Refactored the code based on inputs and comments from Sophia.
Indent `when` one step more than `case`.