Pull this into a base class, maybe?