Moved code into code block