refactor some sources