converted some classes to objects and some function names to apply