Small refactoring, cleaning (still missing some javadocs :))