Performance improvements

Performance improvements are made by removing array null checking and
HTML assumption