Code cleanup

I hope that's helpful, just thought that some code cleaning could come in handy. I'll add a couple of ideas in the issue list.

Thanks for the project!