Move getStyleRule into a service