- Use correct AF type
- Added support for logging
- Minor re-org