Reformated Async task, event reader and added functions to database