more beautiful if/else construct