fix imports, loosen method parameter contracts, add JavaDoc