Changes to make pluggable API
- To be TESTED