Changed: explicit class instead of clousure to cancel JS execution