Separated out creation and update duties to two different files