removing size() use in the client class