attempt to fix complexity on code climate