refactor infrastructure