Few code cleanups

I went through the code and I find just small concerns. Could you please squash these cleanups to your branch? Then please repush to PR.