implement basic service/daemon mode