Cleaned code according to intellij debugger. Nothing important.