refactoring code for better maintainability and code reuse for embedded info feature
fix in error feedback