polished main java class