refactored. casting works... better.