further refactor infrastructure