refactoring containers to dry up