code cleanup and browser launching