clarify comments, refactor a bit, add test build profile for optimizer