candywrapper: code cleanup part 2