source refactor