refining some functions