Added additional checks that only returns the required data and display markup.