Refactor sibyl_srv.c