refactored to account for markdown preview update