Removed useless function, added doc, improved readability.