src update and refactoring