+ refactoring + multiway swithing