some code-style refactoring of %-based spacing logic