Refactor & fix bugs & auto create test vm