Refactor project validation, add test