Moved implementation of Substrate class into structure.py file.