Inlined functions for performance