Added javadoc header
Removed useless lines
Don't use caching in the tests
Splitted some methods to improve readability