Made name field with dynamic width based on attribute type
Code refactoring