remove duplicated code from common module