extract methods to remove an if-eif-elif pattern