init command fix; clean up code