Refactor code and name to introduce database connection creation in Activity