code clean-up: moving common code into base classes