removed database details from index and added functions to db