Removed repeated code