A bit fo refactoring + fixed imports.