project controller update method refactored.
repeated code removed
input variables read ONLY ONCE at the beginning of the method