rewrite with better container classes