skelethon for tests, moved most of the code to a library