reimplemented some functions in Main module