Reduce code dublication