Reduce repetition in project.py