Refactor modal_helper

Refactor private methods to reduce method complexity according to
codeclimate.