Code formatting and cleanup

- Converted indentation to spaces
- Consistent code formatting
- Small cleanup