Refactors controller, to save metrics more dinamically.

Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com>