the use of first here is confusing. Can't it be better handled by the caller ?