Refactoring

Signed-off-by: Mattias Åkerman <mattias@tunity.se>