Refactoring and add unit test for details holder