Cleaning code, tests