Refines tests and adds formatter