Initialising ServiceProvider in the right place