prepare and implement some functions