moved some separated if into else if
Cleanup