Refactor beans