Refactor designer.js

Hi Gabriel,

I have tried to simplify the designer.js, removing all unnecessary code preserving the same features.

Regards