Refactored if statements into well understandble methods