Cleaned up smartpointers, removed CastTo() methods