add library namespace and refacto controllerbase