Use app factory pattern