Apply a project version if applicable

Remove some duplicated code