added scaladoc.
optimize imports and export impl class to file.
removed unnecessary codes.
refactor