refactor details