NXBT-724: code cleanup and format