Refactorings. Removed warnings and deprecated methods.