Better documentation and cleaner code