Dinodex oop

Refactored the code based on inputs and comments from Sophia.
Explicit non-nil checks are usually redundant.