Refactor and update