I've tried to only keep the ui logic / dom manipulation on the js side and I was natural to reuse to log mechanism.