completing modal window and code cleaning