LPS-47692 - general source formatting and removal of unused variables