Refactor python into separate container