improve documentation and more readable code