Enhanced global namespace pollution and removed redundant code