Code cleanup el grande

Hi,
I did some changes as previously discussed. Please test in production!