Some cleanup

Hi @sne11ius,

First, great job ! Thanks.

I made some cleanup in your work, maybe you want to merge it.

Jules