Fix for repeated code