Move newproject post handler to a method.