Modified main file to allow for dependency injection