Done refactoring, source splitted into more files.