Restructure and implement more tests