Made less an optional dependency and added additional checks to ensure it is available