add tests and cleanup some files