improved code section parsing