Fix formatting and factor out shorthand