Cleanup of code 

A great thank to @Screenfeed for his help :)