refactoring of Add File To Project code