some work...

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

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