extracted active_if logic to helper, & misc cleanup
merged with upstream
Merge pull request #35 from johnnymo87/active_if

active_if