move and remove  some functions