Optimized the topleft.js shim