Clean up code & tests