Refactoring test application and reorganizing stuff