Refactored internals