Updating and simplifying code block