Engine class refactoring

* All goto clauses removed.
* Private method added for validating input row and col