Cleanup, typos, refactoring

Signed-off-by: Dominik Schadow <dominikschadow@googlemail.com>