some tests for exercise and some refactors