remove un-used code, and update tests