decomposing and writing GUI and cli