Added data directory to tests directory
Further refactoring fixes