Cast module cleanup

& Started cleaning compare module