Improve code extraction based on #11