fix: correct defgroup declaration and tidy code