clean up controller logic
add optimistic locking