refactor: small refactoring and major reformating (no tabs!)