Refactor projectObject to reduce cyclomatic complexity