Clean up some branching code by using presence
Merge pull request #163 from athal7/branching

Clean up some branching code by using presence