refactored class structure to allow argument passing
refactored some more to improve argument handling