Separated server/lib code