Added PowerGridService to make the logic reusable