slightly improved hardcoded-if with future features in mind