Improved performance (removes jQuery-loops, etc)