minor code cleanup.

Following 8aca90207ffffc9dd512fa11cd9d88d1f4b5884f, remove useless test and tidy-up