Starting to migrate switches to using code blocks