Refactor Position and engine code

Change: more whitespace to organize code blocks.
Change: remove redundant condition.