primary application insfrastructure refactor