Refactoring to accommodate restrictions by python for passing profiles