Remove if's

Reduce complex of method