Formatting and code clean up

I’ve added formatting for right aligned directives and refactored the
class code.