Refactored two classes together so that we can implement window.close()
on button click.