Small refactor.

Change-Id: I8bdf3830e230b5db3d6041fae0d22c05cfc047d8
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>