duplicate some code for testing