Fixed more code duplication