Apply code conventions and minor reshuffling to make idea happy