code cleanup, update master test