Refactor infrastructure commands