add source code note
refactoring python code