moved to intellij and refactor and added docs