reduced number of lines in switch/case statement
fixed integration tests