restructured into a class file