refactor and add OpenStructs