m work on smplification

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

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

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

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