Applied some IntteliJ analyze best practices.