misc

Signed-off-by: Mattias Andrée <maandree@operamail.com>
reduce code complexity

Signed-off-by: Mattias Andrée <maandree@operamail.com>
reduce code complexity

Signed-off-by: Mattias Andrée <maandree@operamail.com>
m

Signed-off-by: Mattias Andrée <maandree@operamail.com>