Refactor code. Organize imports