Refactored to support the Litle SDK 8.27.1 as a library.