Removed redundant code and updated GUI controls