clearfix refactoring

Closes #722