Refactored code by creating AddPanel class