primary infrastructure refactor