add unit tests and clean up code a little bit to re-use names
instead of using strings everywhere.