refactor methods to avoid else block on returning early