get rid of logging and fix switches