Replaced hardcoding with proper implementation.