Tiny internals refactoring