cleaning up count functions