Refactor container monitor into type