Refactored and tried using self but not working