diff --git a/src/ast_handlers.hpp b/src/ast_handlers.hpp
index 0c7f1c3..1feeeab 100644
--- a/src/ast_handlers.hpp
+++ b/src/ast_handlers.hpp
@@ -110,7 +110,6 @@
         } else {
             _pass(context) = false;
         }
-
     }
 };
 
@@ -156,3 +155,61 @@
         return x3::error_handler_result::fail;
     }
 };
+
+struct presenceContainerPathHandler {
+    template <typename T, typename Iterator, typename Context>
+    void on_success(Iterator const&, Iterator const&, T& ast, Context const& context)
+    {
+        auto& parserContext = x3::get<parser_context_tag>(context);
+        const auto& schema = parserContext.m_schema;
+        try {
+            container_ cont = boost::get<container_>(ast.m_path.m_nodes.back());
+            path_ location{decltype(path_::m_nodes)(parserContext.m_curPath.m_nodes.begin(),
+                                                    parserContext.m_curPath.m_nodes.end() - 1)};
+
+            if (!schema.isPresenceContainer(location, cont.m_name)) {
+                _pass(context) = false;
+                return;
+            }
+        } catch (boost::bad_get&) {
+            _pass(context) = false;
+            return;
+        }
+    }
+
+    template <typename Iterator, typename Exception, typename Context>
+    x3::error_handler_result on_error(Iterator&, Iterator const&, Exception const& x, Context const& context)
+    {
+        auto& parserContext = x3::get<parser_context_tag>(context);
+        auto& error_handler = x3::get<x3::error_handler_tag>(context).get();
+        std::string message = "This isn't a path to a presence container.";
+        if (parserContext.m_errorHandled) // someone already handled our error
+            return x3::error_handler_result::fail;
+
+        parserContext.m_errorHandled = true;
+        error_handler(x.where(), message);
+        return x3::error_handler_result::fail;
+    }
+};
+
+struct create_class : public presenceContainerPathHandler {
+};
+
+struct delete_class : public presenceContainerPathHandler {
+};
+
+struct command_class {
+    template <typename Iterator, typename Exception, typename Context>
+    x3::error_handler_result on_error(Iterator&, Iterator const&, Exception const& x, Context const& context)
+    {
+        auto& parserContext = x3::get<parser_context_tag>(context);
+        auto& error_handler = x3::get<x3::error_handler_tag>(context).get();
+        std::string message = "Couldn't parse command.";
+        if (parserContext.m_errorHandled) // someone already handled our error
+            return x3::error_handler_result::fail;
+
+        parserContext.m_errorHandled = true;
+        error_handler(x.where(), message);
+        return x3::error_handler_result::fail;
+    }
+};
