Update and refactor