add some utils functions and note_history function