refactor stashes a bit