Code cleaned up per intellij IDEA's code analysis