improves code and docs