You haven't seen ugly yet.

Ugly is 30 different files, headers and definitions, in separate folders, each with over 5000 lines of codes. ;p
You're doing fine.
As for optimization practices, no comment. The more you work on something, the better you are at optimizing for it.
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10