More Random work; Code refactor