Refactoring : Removing redundant Button generation and "dynamically create buttons".