trying to improve code and docs