[TASK] Changed if statement to resolve cyclomatic complexity - #12