refactor whole project