Move function definition where it belongs

Change-Id: I93e98813d2ffaf7dc648ad81b15e907dfdc276d0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>