more gratuitous refactoring of conditionals + dynamic height functions