remove some duplicate code,
ensure casing on functions matches