started to refactor to utilise pyinterfile