converted 'classes' to using closures&modules