improve block_source swig ext
improve code and block_code swig extensions