Refactor & fix pull/update logic.