condensing and cleanup and formatting