replace ugly macro with function
serial cleanup

- fixup serial lld
- misc cleanup