Cleaned up implementation of realizations method.