Code refactoring and moving oe.lib to oe.core