ENH: Cleaned source code
- Renamed variables
- Fixed memory leaks
- Remove unnecessary code