Adjust documentation and make code more readable