Moving nested functions out to be their own member functions