implement put back, refactor