Refactor: General code refactor and documentation in vim file