Add more tests and add helper functions for tests