Reformat code
Extend tests