cleanup. still missing some tests