decoupled some functions