Improving the code using __proto__ properties