Refactor commit/upload scripts