refactor extension system to be a little faster