moved command save logic to core