Simple code cleanup

just did some cleanup using IDEAs inspections plus some minor readability improvement..