Restructure and make ready for use in bandit