eliminate code dupulication