Fix: Remove repeated code