diff --git a/bob/learn/mlp/cxx/backprop.cpp b/bob/learn/mlp/cxx/backprop.cpp
index d9f029039ed25004b0bbc6ccc5240c0a3b4d63c5..4ffa77310741bbc5e1bbfecd052bdfd133506538 100644
--- a/bob/learn/mlp/cxx/backprop.cpp
+++ b/bob/learn/mlp/cxx/backprop.cpp
@@ -9,8 +9,8 @@
  */
 
 #include <algorithm>
-#include <bob/core/check.h>
-#include <bob/math/linear.h>
+#include <bob.core/check.h>
+#include <bob.math/linear.h>
 
 #include <bob.learn.mlp/backprop.h>
 
diff --git a/bob/learn/mlp/cxx/cross_entropy.cpp b/bob/learn/mlp/cxx/cross_entropy.cpp
index ef9127c7edabd35d4847d08eee024c15c7176fbf..8d190705f1777ac50162ae1812d22d15d327986e 100644
--- a/bob/learn/mlp/cxx/cross_entropy.cpp
+++ b/bob/learn/mlp/cxx/cross_entropy.cpp
@@ -11,7 +11,7 @@
 
 namespace bob { namespace learn { namespace mlp {
 
-  CrossEntropyLoss::CrossEntropyLoss(boost::shared_ptr<bob::machine::Activation> actfun)
+  CrossEntropyLoss::CrossEntropyLoss(boost::shared_ptr<bob::learn::activation::Activation> actfun)
     : m_actfun(actfun),
       m_logistic_activation(m_actfun->unique_identifier() == "bob.machine.Activation.Logistic") {}
 
diff --git a/bob/learn/mlp/cxx/machine.cpp b/bob/learn/mlp/cxx/machine.cpp
index 6ccb42a2ee26524fc1af30edc653f2d5b1a5dcdc..8e6a18245c16d405aa6d5a81a6e98534a644eef9 100644
--- a/bob/learn/mlp/cxx/machine.cpp
+++ b/bob/learn/mlp/cxx/machine.cpp
@@ -12,10 +12,10 @@
 #include <boost/format.hpp>
 #include <boost/make_shared.hpp>
 
-#include <bob/core/check.h>
-#include <bob/core/array_copy.h>
-#include <bob/core/assert.h>
-#include <bob/math/linear.h>
+#include <bob.core/check.h>
+#include <bob.core/array_copy.h>
+#include <bob.core/assert.h>
+#include <bob.math/linear.h>
 
 #include <bob.learn.mlp/machine.h>
 
@@ -24,7 +24,7 @@ bob::learn::mlp::Machine::Machine (size_t input, size_t output):
   m_input_div(input),
   m_weight(1),
   m_bias(1),
-  m_hidden_activation(boost::make_shared<bob::machine::HyperbolicTangentActivation>()),
+  m_hidden_activation(boost::make_shared<bob::learn::activation::HyperbolicTangentActivation>()),
   m_output_activation(m_hidden_activation),
   m_buffer(1)
 {
@@ -40,7 +40,7 @@ bob::learn::mlp::Machine::Machine (size_t input, size_t hidden, size_t output):
   m_input_div(input),
   m_weight(2),
   m_bias(2),
-  m_hidden_activation(boost::make_shared<bob::machine::HyperbolicTangentActivation>()),
+  m_hidden_activation(boost::make_shared<bob::learn::activation::HyperbolicTangentActivation>()),
   m_output_activation(m_hidden_activation),
   m_buffer(2)
 {
@@ -56,7 +56,7 @@ bob::learn::mlp::Machine::Machine (size_t input, const std::vector<size_t>& hidd
   m_input_div(input),
   m_weight(hidden.size()+1),
   m_bias(hidden.size()+1),
-  m_hidden_activation(boost::make_shared<bob::machine::HyperbolicTangentActivation>()),
+  m_hidden_activation(boost::make_shared<bob::learn::activation::HyperbolicTangentActivation>()),
   m_output_activation(m_hidden_activation),
   m_buffer(hidden.size()+1)
 {
@@ -68,7 +68,7 @@ bob::learn::mlp::Machine::Machine (size_t input, const std::vector<size_t>& hidd
 }
 
 bob::learn::mlp::Machine::Machine (const std::vector<size_t>& shape):
-  m_hidden_activation(boost::make_shared<bob::machine::HyperbolicTangentActivation>()),
+  m_hidden_activation(boost::make_shared<bob::learn::activation::HyperbolicTangentActivation>()),
   m_output_activation(m_hidden_activation)
 {
   resize(shape);
@@ -94,7 +94,7 @@ bob::learn::mlp::Machine::Machine (const bob::learn::mlp::Machine& other):
   }
 }
 
-bob::learn::mlp::Machine::Machine (bob::io::HDF5File& config) {
+bob::learn::mlp::Machine::Machine (bob::io::base::HDF5File& config) {
   load(config);
 }
 
@@ -144,7 +144,7 @@ bool bob::learn::mlp::Machine::is_similar_to(const bob::learn::mlp::Machine& oth
 }
 
 
-void bob::learn::mlp::Machine::load (bob::io::HDF5File& config) {
+void bob::learn::mlp::Machine::load (bob::io::base::HDF5File& config) {
   uint8_t nhidden = config.read<uint8_t>("nhidden");
   m_weight.resize(nhidden+1);
   m_bias.resize(nhidden+1);
@@ -167,14 +167,14 @@ void bob::learn::mlp::Machine::load (bob::io::HDF5File& config) {
   //switch between different versions - support for version 2
   if (config.hasAttribute(".", "version")) { //new version
     config.cd("hidden_activation");
-    m_hidden_activation = bob::machine::load_activation(config);
+    m_hidden_activation = bob::learn::activation::load_activation(config);
     config.cd("../output_activation");
-    m_output_activation = bob::machine::load_activation(config);
+    m_output_activation = bob::learn::activation::load_activation(config);
     config.cd("..");
   }
   else { //old version
     uint32_t act = config.read<uint32_t>("activation");
-    m_hidden_activation = bob::machine::make_deprecated_activation(act);
+    m_hidden_activation = bob::learn::activation::make_deprecated_activation(act);
     m_output_activation = m_hidden_activation;
   }
 
@@ -186,7 +186,7 @@ void bob::learn::mlp::Machine::load (bob::io::HDF5File& config) {
   }
 }
 
-void bob::learn::mlp::Machine::save (bob::io::HDF5File& config) const {
+void bob::learn::mlp::Machine::save (bob::io::base::HDF5File& config) const {
   config.setAttribute(".", "version", 1);
   config.setArray("input_sub", m_input_sub);
   config.setArray("input_div", m_input_div);
diff --git a/bob/learn/mlp/cxx/rprop.cpp b/bob/learn/mlp/cxx/rprop.cpp
index 361cdc01c00fb592d18d7e27dea451df519401d6..6d748f2e6e5a22bd12799204aef349bd92edf8d8 100644
--- a/bob/learn/mlp/cxx/rprop.cpp
+++ b/bob/learn/mlp/cxx/rprop.cpp
@@ -9,9 +9,9 @@
  */
 
 #include <algorithm>
-#include <bob/core/check.h>
-#include <bob/core/array_copy.h>
-#include <bob/math/linear.h>
+#include <bob.core/check.h>
+#include <bob.core/array_copy.h>
+#include <bob.math/linear.h>
 
 #include <bob.learn.mlp/rprop.h>
 
diff --git a/bob/learn/mlp/cxx/shuffler.cpp b/bob/learn/mlp/cxx/shuffler.cpp
index 7ea543569f9eab3fef66ee18c35753ceeac6e033..fe93c23e03fe050e2a2e0c15d8cf099ff0626af2 100644
--- a/bob/learn/mlp/cxx/shuffler.cpp
+++ b/bob/learn/mlp/cxx/shuffler.cpp
@@ -11,8 +11,8 @@
 #include <sys/time.h>
 #include <boost/format.hpp>
 
-#include <bob/core/assert.h>
-#include <bob/core/array_copy.h>
+#include <bob.core/assert.h>
+#include <bob.core/array_copy.h>
 
 #include <bob.learn.mlp/shuffler.h>
 
diff --git a/bob/learn/mlp/cxx/square_error.cpp b/bob/learn/mlp/cxx/square_error.cpp
index 6fcf37de4468679c3cad550faf8433bb84580d5c..560116c62d97cf79b9c70eeb068a19cb797a689f 100644
--- a/bob/learn/mlp/cxx/square_error.cpp
+++ b/bob/learn/mlp/cxx/square_error.cpp
@@ -13,7 +13,7 @@
 
 namespace bob { namespace learn { namespace mlp {
 
-  SquareError::SquareError(boost::shared_ptr<bob::machine::Activation> actfun):
+  SquareError::SquareError(boost::shared_ptr<bob::learn::activation::Activation> actfun):
   m_actfun(actfun) {}
 
   SquareError::~SquareError() {}
diff --git a/bob/learn/mlp/cxx/trainer.cpp b/bob/learn/mlp/cxx/trainer.cpp
index f789e79581f88a674a423b3651641ba7147a99ef..7e69a90a86c4b35fe6d9023bc6b7464ed8d690ad 100644
--- a/bob/learn/mlp/cxx/trainer.cpp
+++ b/bob/learn/mlp/cxx/trainer.cpp
@@ -7,9 +7,9 @@
  */
 
 #include <algorithm>
-#include <bob/core/assert.h>
-#include <bob/core/check.h>
-#include <bob/math/linear.h>
+#include <bob.core/assert.h>
+#include <bob.core/check.h>
+#include <bob.math/linear.h>
 
 #include <bob.learn.mlp/trainer.h>
 
@@ -131,13 +131,13 @@ void bob::learn::mlp::Trainer::forward_step(const bob::learn::mlp::Machine& mach
   const std::vector<blitz::Array<double,2> >& machine_weight = machine.getWeights();
   const std::vector<blitz::Array<double,1> >& machine_bias = machine.getBiases();
 
-  boost::shared_ptr<bob::machine::Activation> hidden_actfun = machine.getHiddenActivation();
-  boost::shared_ptr<bob::machine::Activation> output_actfun = machine.getOutputActivation();
+  boost::shared_ptr<bob::learn::activation::Activation> hidden_actfun = machine.getHiddenActivation();
+  boost::shared_ptr<bob::learn::activation::Activation> output_actfun = machine.getOutputActivation();
 
   for (size_t k=0; k<machine_weight.size(); ++k) { //for all layers
     if (k == 0) bob::math::prod_(input, machine_weight[k], m_output[k]);
     else bob::math::prod_(m_output[k-1], machine_weight[k], m_output[k]);
-    boost::shared_ptr<bob::machine::Activation> cur_actfun =
+    boost::shared_ptr<bob::learn::activation::Activation> cur_actfun =
       (k == (machine_weight.size()-1) ? output_actfun : hidden_actfun );
     for (int i=0; i<(int)m_batch_size; ++i) { //for every example
       for (int j=0; j<m_output[k].extent(1); ++j) { //for all variables
@@ -154,7 +154,7 @@ void bob::learn::mlp::Trainer::backward_step
   const std::vector<blitz::Array<double,2> >& machine_weight = machine.getWeights();
 
   //last layer
-  boost::shared_ptr<bob::machine::Activation> output_actfun = machine.getOutputActivation();
+  boost::shared_ptr<bob::learn::activation::Activation> output_actfun = machine.getOutputActivation();
   for (int i=0; i<(int)m_batch_size; ++i) { //for every example
     for (int j=0; j<m_error[m_H].extent(1); ++j) { //for all variables
       m_error[m_H](i,j) = m_cost->error(m_output[m_H](i,j), target(i,j));
@@ -162,7 +162,7 @@ void bob::learn::mlp::Trainer::backward_step
   }
 
   //all other layers
-  boost::shared_ptr<bob::machine::Activation> hidden_actfun = machine.getHiddenActivation();
+  boost::shared_ptr<bob::learn::activation::Activation> hidden_actfun = machine.getHiddenActivation();
   for (size_t k=m_H; k>0; --k) {
     bob::math::prod_(m_error[k], machine_weight[k].transpose(1,0), m_error[k-1]);
     for (int i=0; i<(int)m_batch_size; ++i) { //for every example
diff --git a/bob/learn/mlp/include/bob.learn.mlp/api.h b/bob/learn/mlp/include/bob.learn.mlp/api.h
index 05dba5a3655334df0aba603c51bd93798f387779..24167593a9d9fb1d695fbf0efeac2a8aa3278886 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/api.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/api.h
@@ -10,14 +10,14 @@
 #include <boost/shared_ptr.hpp>
 #include <bob.learn.mlp/config.h>
 
-#include "machine.h"
-#include "cost.h"
-#include "square_error.h"
-#include "cross_entropy.h"
-#include "shuffler.h"
-#include "trainer.h"
-#include "backprop.h"
-#include "rprop.h"
+#include <bob.learn.mlp/machine.h>
+#include <bob.learn.mlp/cost.h>
+#include <bob.learn.mlp/square_error.h>
+#include <bob.learn.mlp/cross_entropy.h>
+#include <bob.learn.mlp/shuffler.h>
+#include <bob.learn.mlp/trainer.h>
+#include <bob.learn.mlp/backprop.h>
+#include <bob.learn.mlp/rprop.h>
 
 #define BOB_LEARN_MLP_MODULE_PREFIX bob.learn.mlp
 #define BOB_LEARN_MLP_MODULE_NAME _library
diff --git a/bob/learn/mlp/include/bob.learn.mlp/backprop.h b/bob/learn/mlp/include/bob.learn.mlp/backprop.h
index 182db40d1661646416b2939f8712a2e4b328eb82..7f719fbe27f2ce135b94fecddfd6a6480aad98be 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/backprop.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/backprop.h
@@ -16,8 +16,8 @@
 #include <vector>
 #include <boost/function.hpp>
 
-#include "machine.h"
-#include "trainer.h"
+#include <bob.learn.mlp/machine.h>
+#include <bob.learn.mlp/trainer.h>
 
 namespace bob { namespace learn { namespace mlp {
 
diff --git a/bob/learn/mlp/include/bob.learn.mlp/cost.h b/bob/learn/mlp/include/bob.learn.mlp/cost.h
index 8614bacd2f85f246c1463158c40492ab0a099540..8d1c11ff80a1de78c2803ce0eacb4585a45107b0 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/cost.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/cost.h
@@ -12,7 +12,6 @@
 
 #include <string>
 #include <boost/shared_ptr.hpp>
-#include "bob/machine/Activation.h"
 
 namespace bob { namespace learn { namespace mlp {
 
diff --git a/bob/learn/mlp/include/bob.learn.mlp/cross_entropy.h b/bob/learn/mlp/include/bob.learn.mlp/cross_entropy.h
index b36b0ab97474b1ce46563453dce5d0d4c5351e73..00f897e447a17d004db409dfba78607cb21d7a14 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/cross_entropy.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/cross_entropy.h
@@ -10,7 +10,8 @@
 #ifndef BOB_LEARN_MLP_CROSSENTROPYLOSS_H
 #define BOB_LEARN_MLP_CROSSENTROPYLOSS_H
 
-#include "cost.h"
+#include <bob.learn.mlp/cost.h>
+#include <bob.learn.activation/Activation.h>
 
 namespace bob { namespace learn { namespace mlp {
 
@@ -55,7 +56,7 @@ namespace bob { namespace learn { namespace mlp {
        *    b = \hat{y} - y
        * \f]
        */
-      CrossEntropyLoss(boost::shared_ptr<bob::machine::Activation> actfun);
+      CrossEntropyLoss(boost::shared_ptr<bob::learn::activation::Activation> actfun);
 
       /**
        * Virtualized destructor
@@ -64,7 +65,7 @@ namespace bob { namespace learn { namespace mlp {
 
       /**
        * Tells if this CrossEntropyLoss is set to operate together with a
-       * bob::machine::LogisticActivation.
+       * bob::learn::activation::LogisticActivation.
        */
       bool logistic_activation() const { return m_logistic_activation; }
 
@@ -118,7 +119,7 @@ namespace bob { namespace learn { namespace mlp {
 
     private: //representation
 
-      boost::shared_ptr<bob::machine::Activation> m_actfun; //act. function
+      boost::shared_ptr<bob::learn::activation::Activation> m_actfun; //act. function
       bool m_logistic_activation; ///< if 'true', simplify backprop_error()
 
   };
diff --git a/bob/learn/mlp/include/bob.learn.mlp/machine.h b/bob/learn/mlp/include/bob.learn.mlp/machine.h
index b4a5ab2eb96746e5ae8649cfcf0020d9ef2eb00b..04a7284eca2a20b50d449338fbb5ed5402dfa840 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/machine.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/machine.h
@@ -15,8 +15,8 @@
 #include <boost/shared_ptr.hpp>
 #include <blitz/array.h>
 
-#include <bob/io/HDF5File.h>
-#include <bob/machine/Activation.h>
+#include <bob.io.base/HDF5File.h>
+#include <bob.learn.activation/Activation.h>
 
 namespace bob { namespace learn { namespace mlp {
 
@@ -90,7 +90,7 @@ namespace bob { namespace learn { namespace mlp {
       /**
        * Starts a new MLP from an existing Configuration object.
        */
-      Machine (bob::io::HDF5File& config);
+      Machine (bob::io::base::HDF5File& config);
 
       /**
        * Just to virtualise the destructor
@@ -123,12 +123,12 @@ namespace bob { namespace learn { namespace mlp {
        * Loads data from an existing configuration object. Resets the current
        * state.
        */
-      void load (bob::io::HDF5File& config);
+      void load (bob::io::base::HDF5File& config);
 
       /**
        * Saves an existing machine to a Configuration object.
        */
-      void save (bob::io::HDF5File& config) const;
+      void save (bob::io::base::HDF5File& config) const;
 
       /**
        * Forwards data through the network, outputs the values of each output
@@ -315,26 +315,26 @@ namespace bob { namespace learn { namespace mlp {
       /**
        * Returns the currently set activation function for the hidden layers
        */
-      boost::shared_ptr<bob::machine::Activation> getHiddenActivation() const
+      boost::shared_ptr<bob::learn::activation::Activation> getHiddenActivation() const
       { return m_hidden_activation; }
 
       /**
        * Sets the activation function for each of the hidden layers.
        */
-      void setHiddenActivation(boost::shared_ptr<bob::machine::Activation> a) {
+      void setHiddenActivation(boost::shared_ptr<bob::learn::activation::Activation> a) {
         m_hidden_activation = a;
       }
 
       /**
        * Returns the currently set output activation function
        */
-      boost::shared_ptr<bob::machine::Activation> getOutputActivation() const
+      boost::shared_ptr<bob::learn::activation::Activation> getOutputActivation() const
       { return m_output_activation; }
 
       /**
        * Sets the activation function for the outputs of the last layer.
        */
-      void setOutputActivation(boost::shared_ptr<bob::machine::Activation> a) {
+      void setOutputActivation(boost::shared_ptr<bob::learn::activation::Activation> a) {
         m_output_activation = a;
       }
 
@@ -366,8 +366,8 @@ namespace bob { namespace learn { namespace mlp {
       blitz::Array<double, 1> m_input_div; ///< input division
       std::vector<blitz::Array<double, 2> > m_weight; ///< weights
       std::vector<blitz::Array<double, 1> > m_bias; ///< biases for the output
-      boost::shared_ptr<bob::machine::Activation> m_hidden_activation; ///< currently set activation type
-      boost::shared_ptr<bob::machine::Activation> m_output_activation; ///< currently set activation type
+      boost::shared_ptr<bob::learn::activation::Activation> m_hidden_activation; ///< currently set activation type
+      boost::shared_ptr<bob::learn::activation::Activation> m_output_activation; ///< currently set activation type
       mutable std::vector<blitz::Array<double, 1> > m_buffer; ///< buffer for the outputs of each layer
 
   };
diff --git a/bob/learn/mlp/include/bob.learn.mlp/roll.h b/bob/learn/mlp/include/bob.learn.mlp/roll.h
index 927b00905f73221cfeff9e76344951c1d5a70bde..10a7d55604f1ff8422a4b953c490580eb63ace91 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/roll.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/roll.h
@@ -11,7 +11,7 @@
 #include <vector>
 #include <blitz/array.h>
 
-#include "machine.h"
+#include <bob.learn.mlp/machine.h>
 
 namespace bob { namespace learn { namespace mlp {
 
diff --git a/bob/learn/mlp/include/bob.learn.mlp/rprop.h b/bob/learn/mlp/include/bob.learn.mlp/rprop.h
index a95c39e2a3415bfc109c5888154c82dd2326b432..4bceb8a956ed7e82c6fa254c9962519d6f7102bd 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/rprop.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/rprop.h
@@ -17,8 +17,8 @@
 #include <vector>
 #include <boost/function.hpp>
 
-#include "machine.h"
-#include "trainer.h"
+#include <bob.learn.mlp/machine.h>
+#include <bob.learn.mlp/trainer.h>
 
 namespace bob { namespace learn { namespace mlp {
 
diff --git a/bob/learn/mlp/include/bob.learn.mlp/square_error.h b/bob/learn/mlp/include/bob.learn.mlp/square_error.h
index eb247e2e8df56d3ffe4523685290ea6e6b5aa16c..089748f885976a254d897bdb089a6c21d14fd85e 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/square_error.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/square_error.h
@@ -10,7 +10,8 @@
 #ifndef BOB_LEARN_MLP_SQUAREERROR_H
 #define BOB_LEARN_MLP_SQUAREERROR_H
 
-#include "cost.h"
+#include <bob.learn.mlp/cost.h>
+#include <bob.learn.activation/Activation.h>
 
 namespace bob { namespace learn { namespace mlp {
 
@@ -32,7 +33,7 @@ namespace bob { namespace learn { namespace mlp {
       /**
        * Builds a SquareError functor with an existing activation function.
        */
-      SquareError(boost::shared_ptr<bob::machine::Activation> actfun);
+      SquareError(boost::shared_ptr<bob::learn::activation::Activation> actfun);
 
       /**
        * Virtualized destructor
@@ -89,7 +90,7 @@ namespace bob { namespace learn { namespace mlp {
 
     private: //representation
 
-      boost::shared_ptr<bob::machine::Activation> m_actfun; //act. function
+      boost::shared_ptr<bob::learn::activation::Activation> m_actfun; //act. function
 
   };
 
diff --git a/bob/learn/mlp/include/bob.learn.mlp/trainer.h b/bob/learn/mlp/include/bob.learn.mlp/trainer.h
index 0188842d021ce610750007a953b15dbc7b36c41e..9432f99b2f3929e9f9cf7d05d93db7d877fc94fa 100644
--- a/bob/learn/mlp/include/bob.learn.mlp/trainer.h
+++ b/bob/learn/mlp/include/bob.learn.mlp/trainer.h
@@ -12,8 +12,8 @@
 #include <vector>
 #include <boost/shared_ptr.hpp>
 
-#include "machine.h"
-#include "cost.h"
+#include <bob.learn.mlp/machine.h>
+#include <bob.learn.mlp/cost.h>
 
 namespace bob { namespace learn { namespace mlp {
 
diff --git a/bob/learn/mlp/version.cpp b/bob/learn/mlp/version.cpp
index 66a72973af8624e7239b58fb7738d99eda39072d..3c9f08328ed7fe113d8388b0974ac83d0c2de663 100644
--- a/bob/learn/mlp/version.cpp
+++ b/bob/learn/mlp/version.cpp
@@ -5,9 +5,12 @@
  * @brief Binds configuration information available from bob
  */
 
-#include <Python.h>
+#ifdef NO_IMPORT_ARRAY
+#undef NO_IMPORT_ARRAY
+#endif
+#include <bob.blitz/capi.h>
+#include <bob.blitz/cleanup.h>
 
-#include <bob/config.h>
 
 #include <string>
 #include <cstdlib>
@@ -16,15 +19,11 @@
 #include <boost/version.hpp>
 #include <boost/format.hpp>
 
-#ifdef NO_IMPORT_ARRAY
-#undef NO_IMPORT_ARRAY
-#endif
-#include <bob.blitz/capi.h>
-#include <bob.blitz/cleanup.h>
+#include <bob.core/config.h>
 #include <bob.io.base/config.h>
+#include <bob.math/config.h>
 #include <bob.learn.activation/config.h>
 #include <bob.learn.mlp/config.h>
-#include <bob.core/config.h>
 
 static int dict_set(PyObject* d, const char* key, const char* value) {
   PyObject* v = Py_BuildValue("s", value);
@@ -84,13 +83,6 @@ static PyObject* python_version() {
   return Py_BuildValue("s", f.str().c_str());
 }
 
-/**
- * Bob version, API version and platform
- */
-static PyObject* bob_version() {
-  return Py_BuildValue("sis", BOB_VERSION, BOB_API_VERSION, BOB_PLATFORM);
-}
-
 /**
  * Numpy version
  */
@@ -120,6 +112,13 @@ static PyObject* bob_core_version() {
   return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(BOB_CORE_API_VERSION));
 }
 
+/**
+ * bob.math c/c++ api version
+ */
+static PyObject* bob_math_version() {
+  return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(BOB_MATH_API_VERSION));
+}
+
 /**
  * bob.learn.activation c/c++ api version
  */
@@ -133,16 +132,17 @@ static PyObject* build_version_dictionary() {
   if (!retval) return 0;
   auto retval_ = make_safe(retval);
 
+  if (!dict_steal(retval, "Bob", bob_core_version())) return 0;
   if (!dict_set(retval, "Blitz++", BZ_VERSION)) return 0;
   if (!dict_steal(retval, "Boost", boost_version())) return 0;
   if (!dict_steal(retval, "Compiler", compiler_version())) return 0;
   if (!dict_steal(retval, "Python", python_version())) return 0;
   if (!dict_steal(retval, "NumPy", numpy_version())) return 0;
   if (!dict_steal(retval, "bob.blitz", bob_blitz_version())) return 0;
-  if (!dict_steal(retval, "bob.io.base", bob_io_base_version())) return 0;
   if (!dict_steal(retval, "bob.core", bob_core_version())) return 0;
+  if (!dict_steal(retval, "bob.math", bob_math_version())) return 0;
+  if (!dict_steal(retval, "bob.io.base", bob_io_base_version())) return 0;
   if (!dict_steal(retval, "bob.learn.activation", bob_learn_activation_version())) return 0;
-  if (!dict_steal(retval, "Bob", bob_version())) return 0;
 
   Py_INCREF(retval);
   return retval;
diff --git a/buildout.cfg b/buildout.cfg
index 99543b51f1fe8a420c3495a9490284e27010d275..c009dbf7817722bb04d0606f501637b250351e63 100644
--- a/buildout.cfg
+++ b/buildout.cfg
@@ -10,23 +10,23 @@ extensions = bob.buildout
 auto-checkout = *
 develop = src/bob.extension
           src/bob.blitz
+          src/bob.core
           src/bob.io.base
+          src/bob.math
           src/bob.learn.activation
-          src/bob.core
           .
 
 ; options for bob.buildout extension
 debug = true
 verbose = true
-prefixes = /idiap/group/torch5spro/releases/preview/install/linux-x86_64-release
-           /Users/andre/work/bob/b/dbg/
 
 [sources]
 bob.extension = git https://github.com/bioidiap/bob.extension
 bob.blitz = git https://github.com/bioidiap/bob.blitz
+bob.core = git https://github.com/bioidiap/bob.core
 bob.io.base = git https://github.com/bioidiap/bob.io.base
+bob.math = git https://github.com/bioidiap/bob.math
 bob.learn.activation = git https://github.com/bioidiap/bob.learn.activation
-bob.core = git https://github.com/bioidiap/bob.core
 
 [scripts]
 recipe = bob.buildout:scripts
diff --git a/setup.py b/setup.py
index 142571235c00c28183784dc0c1bb85cf827275a8..7dc13a6f4832d3ec8b902ad38651e09fea3ad17c 100644
--- a/setup.py
+++ b/setup.py
@@ -3,25 +3,12 @@
 # Andre Anjos <andre.anjos@idiap.ch>
 # Mon 16 Apr 08:18:08 2012 CEST
 
+bob_packages = ['bob.core', 'bob.io.base', 'bob.math', 'bob.learn.activation']
+
 from setuptools import setup, find_packages, dist
-dist.Distribution(dict(setup_requires=['bob.blitz', 'bob.io.base', 'bob.learn.activation', 'bob.core']))
-from bob.blitz.extension import Extension
-import bob.io.base
-import bob.core
-import bob.learn.activation
-
-import os
-package_dir = os.path.dirname(os.path.realpath(__file__))
-package_dir = os.path.join(package_dir, 'bob', 'learn', 'mlp', 'include')
-include_dirs = [
-    package_dir,
-    bob.blitz.get_include(),
-    bob.io.base.get_include(),
-    bob.learn.activation.get_include(),
-    bob.core.get_include(),
-    ]
-
-packages = ['bob-io >= 2.0.0a2', 'bob-machine >= 2.0.0a2']
+dist.Distribution(dict(setup_requires=['bob.blitz'] + bob_packages))
+from bob.blitz.extension import Extension, Library, build_ext
+
 version = '2.0.0a0'
 
 setup(
@@ -44,6 +31,7 @@ setup(
       'setuptools',
       'bob.blitz',
       'bob.io.base',
+      'bob.math',
       'bob.learn.activation',
       'bob.core',
     ],
@@ -57,11 +45,26 @@ setup(
       Extension("bob.learn.mlp.version",
         [
           "bob/learn/mlp/version.cpp",
-          ],
-        packages = packages,
-        include_dirs = include_dirs,
+        ],
+        bob_packages = bob_packages,
+        version = version,
+      ),
+
+      Library("bob.learn.mlp.bob_learn_mlp",
+        [
+          "bob/learn/mlp/cxx/roll.cpp",
+          "bob/learn/mlp/cxx/machine.cpp",
+          "bob/learn/mlp/cxx/cross_entropy.cpp",
+          "bob/learn/mlp/cxx/square_error.cpp",
+          "bob/learn/mlp/cxx/shuffler.cpp",
+          "bob/learn/mlp/cxx/trainer.cpp",
+          "bob/learn/mlp/cxx/backprop.cpp",
+          "bob/learn/mlp/cxx/rprop.cpp",
+        ],
+        bob_packages = bob_packages,
         version = version,
-        ),
+      ),
+
       Extension("bob.learn.mlp._library",
         [
           "bob/learn/mlp/roll.cpp",
@@ -72,25 +75,20 @@ setup(
           "bob/learn/mlp/cost.cpp",
           "bob/learn/mlp/machine.cpp",
           "bob/learn/mlp/main.cpp",
-          "bob/learn/mlp/cxx/roll.cpp",
-          "bob/learn/mlp/cxx/machine.cpp",
-          "bob/learn/mlp/cxx/cross_entropy.cpp",
-          "bob/learn/mlp/cxx/square_error.cpp",
-          "bob/learn/mlp/cxx/shuffler.cpp",
-          "bob/learn/mlp/cxx/trainer.cpp",
-          "bob/learn/mlp/cxx/backprop.cpp",
-          "bob/learn/mlp/cxx/rprop.cpp",
-          ],
-        packages = packages,
-        include_dirs = include_dirs,
+        ],
+        bob_packages = bob_packages,
         version = version,
-        ),
-      ],
+      ),
+    ],
+
+    cmdclass = {
+      'build_ext': build_ext
+    },
 
     entry_points={
       'console_scripts': [
-        ],
-      },
+      ],
+    },
 
     classifiers = [
       'Development Status :: 3 - Alpha',