linted and fixes + aliased when -> then