controller: Move avatar logic to its own class