Refactor a bit of stylization code