refactoring for details using methods