refactor source structure