Some minor refactoring
Merge branch 'lego-8934' into 0.3