move common code to separate module, vol.1