moved test code out of application code