REFACTOR: python cleanup