Cleaner code for pathMkaer