re-write functions in common