Refactor: move complex logic of ng-disabled/if/show/hide to controller