optimise and strip down for lightweight server