Refactor attempt # 1

- Renamed all internal functions not meant for SDK users, to begin with underscore
- Removed variables and functions that are not needed.