Performance improvements (now uses only one Date object declaration inside plugin)