Cleaned up pie view code