Refactored GenServer