Fix wrong service ref and some code styles