Refactor to match basic servlet requirements