Instead of applyAvatar() use a directive