change switch to if/else (check on default values)