removed more 'window.' prefixes for consistency