Implemented common functions.