Refactored to SimpleCursorAdapter and added utility functions