Refactored dialog window into own component