Refactored to ContentProvider

It now is structured in a more maintainable fashion and well organized.